Get Last Transaction
The Get Last Transaction API allows the user to retrieve the most recent transaction processed by a specific terminal. This is useful for the cashier to verify the latest payment activity, status tracking, etc.
Endpoint
Method: GET
URL: baseUrl/api/v1/transactions/latest
Heades
Authorization: Bearer {{accessToken}}(Include the token obtained from the Authentication API)Content-Type: application/json
Sample Response
{
"id": 997,
"amount": 10000,
"status": "INITIALIZED",
"terminal": 68,
"date": "2025-07-03T12:36:03.479506",
"rrn": "316603000042",
"cardType": "mada",
"terminalId": "1234567812121250",
"acquirerCode": "RYDB",
"merchantAr": "إختبار مدى",
"merchantEn": "mada Test",
"addAr": "العليا,الرياض",
"addEn": "Al-Olaya, Riyadh",
"merchantId": "800150400566",
"merchantCategoryCode": "5411",
"stan": "000042",
"madaAppVersion": "1.2.51",
"cardSchemeAr": "مدى",
"cardSchemeEn": "mada",
"transactionTypeAr": "شراء",
"transactionTypeEn": "PURCHASE",
"pan": "535825******5490",
"cardExpiration": "2409",
"amountAuthorizedValue": "900",
"amountAuthorizedAr": "ريال",
"amountAuthorizedEn": "SAR",
"statusMessageAr": "مقبولة",
"statusMessageEn": "APPROVED",
"verificationMethodAr": "لا يتطلب التحقق",
"verificationMethodEn": "NO VERIFICATION REQUIRED",
"approvalCodeAr": null,
"approvalCodeEn": null,
"approvalCodeValue": "803774",
"endDate": null,
"endTime": null,
"thanksMessageAr": null,
"thanksMessageEn": null,
"saveReceiptMessageAr": null,
"saveReceiptMessageEn": null,
"entryMode": "CONTACTLESS",
"actionCode": "000",
"applicationIdentifier": "A0000002281010",
"terminalVerificationResult": "0400000801",
"transactionStateInformation": "0000",
"cardholaderVerficationResult": "1F0302",
"cryptogramInformationData": "6DDF1F910E6855F7",
"applicationCryptogram": null,
"kernelId": "02",
"paymentAccountReference": null,
"cashierName": "CashierAmnk",
"branchName": "العليا الرئيسي",
"providerResponseCode": null,
"uuid": "153f2c54-45c2-3c3e-a4b0-d1bf1528343a"
}
Attributes Reference Table
| Field | Type | Description |
|---|---|---|
| id | Integer | Transaction ID in the database |
| amount | Integer | Transaction amount in sub-units (e.g., halalas) |
| status | String | Current transaction status (e.g., INITIALIZED, APPROVED) |
| date | Timestamp | Date and time the transaction was initiated |
| rrn | String | Retrieval Reference Number (RRN) |
| terminalId | String | Unique identifier of the POS terminal |
| acquirerCode | String | Code of the acquiring bank |
| merchantEn | String | Merchant name (English) |
| merchantAr | String | Merchant name (Arabic) |
| addEn | String | Merchant address (English) |
| addAr | String | Merchant address (Arabic) |
| merchantId | String | Merchant ID assigned by the bank/acquirer |
| cardType | String | Card type used in transaction (e.g., mada, Visa) |
| cardSchemeEn | String | Card scheme in English (e.g., mada) |
| transactionTypeEn | String | Type of transaction (e.g., PURCHASE) |
| pan | String | Masked Primary Account Number |
| approvalCodeValue | String | Approval code from acquirer |
| entryMode | String | Method of card entry (e.g., CONTACTLESS, CHIP) |
| statusMessageEn | String | Result message for the transaction |
| verificationMethodEn | String | How cardholder was verified |
| cashierName | String | Name of the cashier handling the transaction |
| branchName | String | Merchant branch where transaction occurred |
| uuid | UUID | Unique identifier of transaction for traceability |
Usage Tips
- This API is ideal for fetching receipt data after a successful transaction, or for reconfirming recent POS activity.
- If a transaction does not appear as confirmed on the client app due to a connectivity issue, Use the status and statusMessageEn fields to validate transaction success before printing receipts or showing confirmation.
- Be sure to securely store or display the masked PAN only (e.g., 535825******5490), never the full card number.